package cn.keniykey.mc.landterritory.landview;

import org.bukkit.entity.Player;

import cn.keniykey.mc.landterritory.LandTerritoryMain;
import cn.keniykey.mc.viewlibrary.view.api.AbFrameView;
import cn.keniykey.mc.viewlibrary.view.api.IViewClickHandler;
import cn.keniykey.mc.viewlibrary.view.api.ViewClickReport;

public abstract class AbLandFrameView  extends AbFrameView{

	protected AbLandFrameView(Player player1) {
		super(LandTerritoryMain.getPlugin(), player1);
	}
	
	private static final IViewClickHandler OUT_CLICK = new IViewClickHandler() {	
		@Override
		public void onClick(Player player, AbFrameView view, ViewClickReport report) {
			view.finishAll();
		}
	};
	static final IViewClickHandler CLICK_BACK = new IViewClickHandler() {
		@Override
		public void onClick(Player player, AbFrameView view, ViewClickReport report) {
			view.finish();
		}
	};
	
	@Override
	protected void onCreate() {
		super.onCreate();
		this.setOutSizeClickHandler(OUT_CLICK);
	}

	public boolean isMatchClickSpeed() {
		return ((LandViewContentShare) this.getAbFrameViewActivity()).isMatchClickSpeed();
	}
}